SET NOCOUNT ON
declare @TableName varchar(MAX)
set @TableName = 'Occupation'

PRINT 'public class Response' + @TableName
PRINT '{'
SELECT '	public ' +
	case DataType
		when 'varchar' then 'string'
		when 'datetime' then 'DateTime'
		when 'date' then 'DateTime'
		when 'int' then 'int'
		when 'tinyint' then 'byte'		
		when 'decimal' then 'decimal'
		when 'bit' then 'bool'
		when 'uniqueidentifier' then 'Guid'
		else 'Object'
	end + ' ' + ColumnName + ' { get; set; }'
FROM (
	SELECT A.name ColumnName, B.name DataType
	FROM sys.columns A
		left join sys.types B on A.user_type_id = B.user_type_id
	WHERE object_id = OBJECT_ID(@TableName) 
) TBL
PRINT '}'
--SELECT * FROM sys.types